<?php 

namespace App\ModelFilters;

use EloquentFilter\ModelFilter;

class PostFilter extends ModelFilter
{
    /**
    * Related Models that have ModelFilters as well as the method on the ModelFilter
    * As [relationMethod => [input_key1, input_key2]].
    *
    * @var array
    */
    public $relations = [
                'user'=>['id','name'],
            ];

    public function setup()
    {
        //$this->related('user');
    }
    public function username($name)
    {
        return $this->related('user', 'name', '=', $name);
    }

}
